home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 632 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.1 KB

  1. Path: chronicle.mti.sgi.com!austern
  2. From: boukanov@kvark.fi.uib.no (Igor Boukanov)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: constant-expression extension
  5. Date: 05 Mar 1996 09:44:14 PST
  6. Organization: Fysisk institutt, Universitetet i Bergen
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <4hh34b$21r@ugress.uib.no>
  9. References: <4h775a$m4s@ugress.uib.no> <KANZE.96Mar4120725@gabi.gabi-soft.fr>
  10. NNTP-Posting-Host: isolde.mti.sgi.com
  11. X-Original-Date: 5 Mar 1996 09:56:27 GMT
  12. X-Newsreader: TIN [version 1.2 PL2]
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBVAwUBMTx9g0y4NqrwXLNJAQE3SQH+I4jWGL7LvAWWkiibThLzNqajQvTrGTNH
  15.     LxFJ3+vZFGg28zanKKbq45Z3AhVldJXhtgmRBMeCmQPv9aJmUtYMHA==
  16.     =14+b
  17. Originator: austern@isolde.mti.sgi.com
  18.  
  19. J. Kanze (kanze@gabi-soft.fr) wrote:
  20. > That it would be nice, but that there are two very big problems:
  21.  
  22. > 1. It would basically require a complete C++ interpreter in the
  23. > compiler, and
  24.  
  25. But in almost all cases such interpreter is already present in C++ 
  26. compilers! Because of cause all such const look expressions are correct 
  27. C++ expressions so every C++ compiler has to generate a code that will 
  28. evaluate them at run time and if forget about the crosscompilation case 
  29. I think instead of putting the code to object file compiler can just execute 
  30. it...
  31.  
  32. > 2. It would make the notion of constant expression somewhat
  33. > implementation dependant.  Suppose my compiler implements the function
  34. > sin as an inline invocation of a compiler built-in.  Can I then use sin
  35. > in a constant expression?
  36.  
  37. Consider, for example, next:
  38. const double x = 1.0 / (very small number); 
  39. And of cause, the result will depend on exact representation of double... 
  40.  
  41. --
  42. Regards, Igor Boukanov 
  43. // igor.boukanov@fi.uib.no  http://www.fi.uib.no/~boukanov/
  44. ---
  45. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  46.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  47.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  48.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  49.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  50. ]
  51.